package com.hejia.alauda.service;

import java.util.List;

import com.hejia.alauda.entity.BaseEntity;
import com.hejia.alauda.entity.example.Example;
import com.hejia.alauda.utils.Pager;

public interface BaseService<T extends BaseEntity> {
	
	T selectByPrimaryKey(Long id);
	
	T selectOneByExample(Example<T> example);
	
	List<T> selectByExample(Example<T> example, Pager<T> pager);
	
	int insert(T record);
	
	int insertWithNullValue(T record);
	
	int countByExample(Example<T> example);
	
	int countColByExample(String col,Example<T> example);
	
	Double sumByExample(String field,Example<T> example);
	 
	int deleteByExample(Example<T> example);
	 
	int deleteByPrimaryKey(T entity);
	 
	int updateByExample( T record,  Example<T> example);
	
	int updateByExampleWithNullValue( T record, Example<T> example);
	
	int updateByPrimaryKey(T record);
	
	int updateByPrimaryKeyWithNullValue(T record);
}
